<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="Note: This quickstart depends on features introduced in Hugo v0.11. If you have an earlier version of Hugo, you will need to upgrade before proceeding.
 Step 1. Install Hugo Go to Hugo Releases and download the appropriate version for your OS and architecture.
Save the main executable as hugo (or hugo.exe on Windows) somewhere in your PATH as we will be using it in the next step.
More complete instructions are available at Installing Hugo.">
        <link rel="alternate" href="https://www.feiyangkeji.com/feed.xml" type="application/rss+xml" title="阳阳学编程">
        <link rel="icon" href="https://www.feiyangkeji.com/favicon.ico">
        <title>Hugo Quickstart Guide - 阳阳学编程</title>
        <link rel="stylesheet" href="https://www.feiyangkeji.com/css/highlight.js.min.css">
        <link rel="stylesheet" href="https://www.feiyangkeji.com/css/bootstrap.min.css">
        <link rel="stylesheet" href="https://www.feiyangkeji.com/css/bootstrap-theme.css">
        <link rel="stylesheet" href="https://www.feiyangkeji.com/css/font-awesome/css/font-awesome.min.css" />
        
        <link rel="stylesheet" href="https://www.feiyangkeji.com/css/hugo-org.css">
    </head>

<body role="document">
    <nav class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="https://www.feiyangkeji.com/">阳阳学编程</a>
            </div>
            <div id="navbar" class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    
                    <li ><a href="https://www.feiyangkeji.com/">主页</a></li>
                    <li ><a href="https://www.feiyangkeji.com/doc">固件下载</a></li>
                   
                    
                    <li ><a href="https://www.feiyangkeji.com/post/">文章列表</a></li>
                    
                    <li ><a href="https://www.feiyangkeji.com/theme/">开源项目</a></li>
                    
                    <li ><a href="https://www.feiyangkeji.com/showcase/">免费资源</a></li>
                    
                    <li ><a href="https://www.feiyangkeji.com/donate/">关于</a></li>
                    

                </ul>
            </div>
        </div>
    </nav>



<div class="container-fluid">

<div class="row">
    <div class="col-xs-12 col-sm-3">
        
<aside>
    <div class="well">
        
        <div class="pull-right">智能开关固件 v2.0.1(开发中...)</div>
        <ul class="nav nav-list">
            
            
            
            <li>
                <label class="tree-toggle nav-header">快速开始</label>
                <ul class="nav nav-list">
                    
                    <li>
                        <a href="https://www.feiyangkeji.com/doc/overview/quickstart/">Quickstart</a>
                    </li>
                    
                </ul>
            
            </li>
            
            
            <li>
                <label class="tree-toggle nav-header">内容(Content)</label>
                <ul class="nav nav-list">
                    
                    <li>
                        <a href="https://www.feiyangkeji.com/doc/content/archetypes/">Archetypes</a>
                    </li>
                    
                    <li>
                        <a href="https://www.feiyangkeji.com/doc/content/example_en/">Example</a>
                    </li>
                    
                </ul>
            
            </li>
            
            
            <li>
                <label class="tree-toggle nav-header">分类(Taxonomies)</label>
                <ul class="nav nav-list">
                    
                    <li>
                        <a href="https://www.feiyangkeji.com/doc/taxonomies/displaying/">Displaying</a>
                    </li>
                    
                </ul>
            
            </li>
            
            
            <li>
                <label class="tree-toggle nav-header">常见问题</label>
                <ul class="nav nav-list">
                    
                    <li>
                        <a href="https://www.feiyangkeji.com/doc/troubleshooting/overview/">Troubleshooting Overview</a>
                    </li>
                    
                </ul>
            
            </li>
            
            
            <li>
                <label class="tree-toggle nav-header">关于Hugo</label>
                <ul class="nav nav-list">
                    
                    <li>
                        <a href="https://www.feiyangkeji.com/doc/meta/license/">License</a>
                    </li>
                    
                </ul>
            
            </li>
            
            
            <li>
                <label class="tree-toggle nav-header">community</label>
                <ul class="nav nav-list">
                    
                    <li>
                        <a href="https://www.feiyangkeji.com/doc/community/mailing-list/">Mailing List</a>
                    </li>
                    
                    <li>
                        <a href="http://discuss.gohugo.io">讨论社区</a>
                    </li>
                    
                </ul>
            
            </li>
            
            
            <li>
                <label class="tree-toggle nav-header">extras</label>
                <ul class="nav nav-list">
                    
                    <li>
                        <a href="https://www.feiyangkeji.com/doc/extras/shortcodes/">Shortcodes</a>
                    </li>
                    
                    <li>
                        <a href="https://www.feiyangkeji.com/doc/extras/toc_en/">Table of Contents</a>
                    </li>
                    
                </ul>
            
            </li>
            
            
            <li>
                <label class="tree-toggle nav-header">layout</label>
                <ul class="nav nav-list">
                    
                    <li>
                        <a href="https://www.feiyangkeji.com/doc/templates/terms_en/">Taxonomy Terms</a>
                    </li>
                    
                    <li>
                        <a href="https://www.feiyangkeji.com/doc/templates/sitemap/">Sitemap</a>
                    </li>
                    
                </ul>
            
            </li>
            
            
            <li>
                <label class="tree-toggle nav-header">themes</label>
                <ul class="nav nav-list">
                    
                    <li>
                        <a href="https://www.feiyangkeji.com/doc/themes/creation/">Creating a Theme</a>
                    </li>
                    
                </ul>
            
            </li>
            
            
            <li>
                <label class="tree-toggle nav-header">tutorials</label>
                <ul class="nav nav-list">
                    
                    <li>
                        <a href="https://www.feiyangkeji.com/doc/tutorials/automated-deployments/">Automated deployments</a>
                    </li>
                    
                </ul>
            
            </li>
            
            
              
            <li>
                <a href="https://github.com/coderzh/feiyangkeji.com/edit/master/content/doc/overview/quickstart_en.md" target="blank">
                <i class='fa fa-edit'></i>修改此文章</a>
            </li>
            
            
        </ul>
    </div>
</aside>


    </div>
    <div class="col-xs-12 col-sm-9 doc-main">
        <main role="main">
            <article>
                <a id="title"></a>
                <h1 class="doc-entry-title">Hugo Quickstart Guide</h1>
                <section>
                    <blockquote>
<p><em>Note: This quickstart depends on features introduced in Hugo v0.11.  If you have an earlier version of Hugo, you will need to <a href="https://www.feiyangkeji.com/doc/overview/installing/">upgrade</a> before proceeding.</em></p>
</blockquote>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<h2 id="step-1-install-hugo">Step 1. Install Hugo</h2>
<p>Go to <a href="https://github.com/spf13/hugo/releases">Hugo Releases</a> and download the
appropriate version for your OS and architecture.</p>
<p>Save the main executable as <code>hugo</code> (or <code>hugo.exe</code> on Windows) somewhere in your <code>PATH</code> as we will be using it in the next step.</p>
<p>More complete instructions are available at <a href="https://www.feiyangkeji.com/doc/overview/installing/">Installing Hugo</a>.</p>
<h2 id="step-2-have-hugo-create-a-site-for-you">Step 2. Have Hugo Create a site for you</h2>
<p>Hugo has the ability to create a skeleton site:</p>
<pre><code class="hljs nohighlight">$ hugo new site <i>path/to/site</i>
</code></pre>

<p>For the rest of the operations, we will be executing all commands from within the site directory.</p>
<pre><code class="hljs nohighlight">$ cd <i>path/to/site</i>
</code></pre>

<p>The new site will have the following structure</p>
<pre><code class="hljs nohighlight">  ▸ archetypes/
  ▸ content/
  ▸ data/
  ▸ layouts/
  ▸ static/
    config.toml
</code></pre>

<p>Currently the site doesn’t have any content, nor is it configured.</p>
<h2 id="step-3-create-some-content">Step 3. Create Some Content</h2>
<blockquote>
<p>If you used a different blogging platform such as Jekyll, Ghost or Wordpress and you
want convert your content, take a look at this list of <a href="https://www.feiyangkeji.com/doc/tools/#migration-tools"> migration tools</a>.</p>
</blockquote>
<p>Hugo also has the ability to create a skeleton content page:</p>
<pre><code>$ hugo new about.md
</code></pre>
<p>A new file is now created in <code>content/</code> with the following contents:</p>
<pre><code>+++
date = &quot;2015-01-08T08:36:54-07:00&quot;
draft = true
title = &quot;about&quot;

+++

</code></pre><p>Notice the date is automatically set to the moment you created the content.</p>
<p>Place some content in Markdown format below the <code>+++</code> in this file.
For example:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-markdown" data-lang="markdown"><span style="color:#75715e">## A headline
</span><span style="color:#75715e"></span>
Some Content
</code></pre></div><p>For fun, let’s create another piece of content and place some Markdown in it as well.</p>
<pre><code>$ hugo new post/first.md
</code></pre>
<p>The new file is located at <code>content/post/first.md</code></p>
<p>We still lack any templates to tell us how to display the content.</p>
<h2 id="step-4-install-some-themes">Step 4. Install some themes</h2>
<p>Hugo has rich theme support and a growing set of themes to choose from.
To install the latest version of all of the available Hugo themes, simply clone the entire <strong>hugoThemes</strong> repository from within your working directory:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ git clone --depth <span style="color:#ae81ff">1</span> --recursive https://github.com/spf13/hugoThemes.git themes
</code></pre></div><h2 id="step-5-run-hugo">Step 5. Run Hugo</h2>
<p>Hugo contains its own high-performance web server. Simply run <code>hugo server</code> and Hugo will find an available port and run a server with
your content:</p>
<pre><code>$ hugo server --theme=hyde --buildDrafts
2 of 2 drafts rendered
0 future content
2 pages created
0 paginator pages created
0 tags created
0 categories created
in 15 ms
Watching for changes in /home/user/exampleHugoSite/{data,content,layouts,static,themes}
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
</code></pre>
<p>We specified two options here:</p>
<ul>
<li><code>--theme</code> to pick which theme;</li>
<li><code>--buildDrafts</code> because we want to display our content, both set to draft status.</li>
</ul>
<p>To learn about what other options hugo has, run:</p>
<pre><code>$ hugo help
</code></pre>
<p>To learn about the server options:</p>
<pre><code>$ hugo help server
</code></pre>
<h2 id="step-6-edit-content">Step 6. Edit Content</h2>
<p>Not only can Hugo run a server, but it can also watch your files for
changes and automatically rebuild your site. Hugo will then
communicate with your browser and automatically reload any open page.
This even works in mobile browsers.</p>
<p>Stop the Hugo process by hitting <!-- raw HTML omitted -->Ctrl<!-- raw HTML omitted -->+<!-- raw HTML omitted -->C<!-- raw HTML omitted -->. Then run the following:</p>
<pre><code>$ hugo server --theme=hyde --buildDrafts
2 pages created
0 tags created
0 categories created
in 5 ms
Watching for changes in exampleHugoSite/content
Serving pages from exampleHugoSite/public
Web Server is available at http://localhost:1313
Press Ctrl+C to stop
</code></pre>
<p>Open your <a href="http://vim.spf13.com/">favorite editor</a>, edit and save your content, and watch as Hugo rebuilds and reloads automatically.</p>
<p>It’s especially productive to leave a browser open on a second monitor
and just glance at it whenever you save. You don’t even need to tab to
your browser. Hugo is so fast that the new site will be there before
you can look at the browser in most cases.</p>
<p>Change and save this file. Notice what happened in your terminal:</p>
<pre><code>Change detected, rebuilding site
2015-11-27 15:13 +0100
2 of 2 drafts rendered
0 future content
2 pages created
0 paginator pages created
0 tags created
0 categories created
in 11 ms
</code></pre>
<h2 id="step-7-have-fun">Step 7. Have fun</h2>
<p>The best way to learn something is to play with it.</p>
<p>Things to try:</p>
<ul>
<li>Add a <a href="https://www.feiyangkeji.com/doc/content/organization/">new content file</a></li>
<li>Create a <a href="https://www.feiyangkeji.com/doc/content/sections/">new section</a></li>
<li>Modify <a href="https://www.feiyangkeji.com/layout/templates/">a template</a></li>
<li>Create content with <a href="https://www.feiyangkeji.com/doc/content/front-matter/">TOML front matter</a></li>
<li>Define your own field in <a href="https://www.feiyangkeji.com/doc/content/front-matter/">front matter</a></li>
<li>Display that <a href="https://www.feiyangkeji.com/layout/variables/">field in the template</a></li>
<li>Create a <a href="https://www.feiyangkeji.com/doc/content/types/">new content type</a></li>
</ul>

                </section>
            </article>
        </main>
        <br />
        
        <div class="row">
            <div class="col-xs-6 col-sm-6 text-center">
                
                <a href="https://www.feiyangkeji.com/doc/overview/introduction">&lt; 上一篇</a>
                
            </div>
            <div class="col-xs-6 col-sm-6 text-center">
                
                <a href="https://www.feiyangkeji.com/doc/overview/installing">下一篇 &gt;</a>
                
            </div>
        </div>
        
    </div> 
</div>



<hr />

<div class="row">
    <div class="col-sm-12">
        
	    <div class="text-center">
        
		    <p class="doc-footer-em"><a href="#">回到顶部↑</a></p>
	    </div>
	</div>
</div>

</div> 

<footer class="doc-footer">
	
    <p>Copyright © <a href="http://www.feiyangkeji.com/"> 北京飞阳信远科技有限公司(京ICP备2021020257号-1 )</a> 2021. Generated by <a href="http://gohugo.io/">Hugo</a></p>
</footer>

<script>
	(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
	ga('create', 'UA-10147768-3', 'auto');
	ga('send', 'pageview');
</script>

<script src="https://www.feiyangkeji.com/js/jquery-1.11.2.min.js"></script>
<script src="https://www.feiyangkeji.com/js/bootstrap.min.js"></script>

<script src="https://www.feiyangkeji.com/js/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="https://www.feiyangkeji.com/js/ie10-viewport-bug-workaround.js"></script>

</body>
</html>

